package in.unlocker.apps.unlock.dao;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

public class BaseRepository
{

	@PersistenceContext
	protected EntityManager entityManager;

	public Object getById(Class classObject, Object id)
	{
		return entityManager.find(classObject, id);
	}
	
	public void save(Object object){
		entityManager.persist(object);
		entityManager.flush();
	}
	
	public void update(Object object) {
		entityManager.persist(object);
		entityManager.flush();
		
	}
}
